
import { Blog } from "../model/Blogs.js"

const fn_list = async(ctx,next)=>{
    ctx.body='过滤'
    let blog=await Blog.findAll()
    ctx.body={
        code:1000,
        msg:"查询成功",
        data:blog
    }
}
const fn_getById = async(ctx,next)=>{
    ctx.body='过滤'

}

const fn_add = async(ctx,next)=>{
    ctx.body='过滤'
}
const fn_edit = async(ctx,next)=>{
    ctx.body='过滤'
}
const fn_del = async(ctx,next)=>{
    ctx.body='删除'
}

export default[
    {
        method:"get",
        url:"/blogs",
        fn:fn_list
    },
    {
        method:"get",
        url:"/blogs/id",
        fn:fn_getById
    },
    {
        method:"post",
        url:"/blogs",
        fn:fn_add
    },
    {
        method:"put",
        url:"/blogs/id",
        fn:fn_edit
    },
    {
        method:"get",
        url:"/blogs/id",
        fn:fn_del
    }
]